package com.myboot.schedule;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.Date;

/**
 * 自定义定时任务
 * Created by liuhuan on 2017/1/11.
 */
//@Configuration
@EnableScheduling
public class MySchedule {

    @Scheduled(cron = "0/20 * * * * ?")
    public void saySomethingOnSchedule() {
        System.out.println("Say now:" + new Date());
    }
}
